//
//  Constant.h
//  TSDemo
//
//  Created by 汪小芳 on 2018/7/3.
//  Copyright © 2018年 WF. All rights reserved.
//

#ifndef Constant_h
#define Constant_h


/*
 获取屏幕宽度与高度
 */
#define SCREEN_WIDTH  [UIScreen mainScreen].bounds.size.width
#define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height
//相对iphone6 屏幕宽度比
#define KWidth_Scale    [UIScreen mainScreen].bounds.size.width/375.0f
//相对iPhone6 屏幕高度比
#define KHeight_Scale [UIScreen mainScreen].bounds.size.height/667.0f

//iPhoneX导航条的高度
#define SafeAreaTopHeight (SCREEN_HEIGHT == 812.0 ? 88 : 64)
/// 设置你底部的按钮距离底部34即可，但是不要让上面的试图的高度盖住底部按钮
#define SafeAreaBottomHeight (SCREEN_HEIGHT == 812.0 ? 34 : 0)
//iPhoneX状态栏的高度
#define SafeArealanHeight (SCREEN_HEIGHT == 812.0 ? 44: 20)
/// 第一个参数是当下的控制器适配iOS11 一下的，第二个参数表示scrollview或子类
#define AdjustsScrollViewInsetNever(controller,view) if(@available(iOS 11.0, *)) {view.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;} else if([controller isKindOfClass:[UIViewController class]]) {controller.automaticallyAdjustsScrollViewInsets = false;}
//获取TabBar标签栏高度(iphoneX 49+34)
#define TabBar_HEIGHT (49)
#define PAGESIZE @10        //每页获取数据数量宏
/** 菜单列表顶部标题的高度 */
#define MHTitilesViewH  50

/**12-29 字体适配*/
//#define kScaleFit (SCREEN_WIDTH / 375.0f)


/**
 CGRectGet
 */
#define GetHeight(view) CGRectGetHeight(view.frame)
#define GetWidth(view) CGRectGetWidth(view.frame)
#define GetMaxX(view) CGRectGetMaxX(view.frame)
#define GetMaxY(view) CGRectGetMaxY(view.frame)
#define GetMidX(view) CGRectGetMidX(view.frame)
#define GetMidY(view) CGRectGetMidY(view.frame)
#define GetMinX(view) CGRectGetMinX(view.frame)
#define GetMinY(view) CGRectGetMinY(view.frame)
/**
 字体
 */
#define FONT(F)  [UIFont fontWithName:@"Helvetica" size:F]//[UIFont systemFontOfSize:F]
#define BFONT(F)  [UIFont boldSystemFontOfSize:F]
/**
 颜色
 */
#define RGBColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
#define RGBAColor(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(r)/255.0 blue:(r)/255.0 alpha:a]
#define RGBHex(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#define RGBHexAlpha(rgbValue,a) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:(a)]

#define ClearColor [UIColor clearColor]  //清除背景色
#define BACKGROUNDCOLOR RGBColor(246, 246, 246)//背景色 f0f0f0
#define LineCOLOR RGBColor(240, 240, 240)//背景色 f0f0f0
#define WHITECOLOR [UIColor whiteColor]//-- 白色
#define BLACKCOLOR [UIColor blackColor]//-黑色
#define BLACKTEXTCOLOR RGBColor(51, 51, 51)//-黑色///33333
#define SHENTEXTCOLOR RGBColor(102, 102, 102)//深色/666666
#define LIGHTTEXTCOLOR RGBColor(153, 153, 153)//灰色///999999
#define GRAYCOLOR RGBColor(230, 230, 230)//---浅色//e6e6e6、/切割线色
#define GLOBALCOLOR RGBColor(27,158,106)//绿色///
#define OrangeCOLOR RGBColor(252,84,0)//橘色、价格数据颜色
#define IndicatorColor RGBColor(227, 230, 234)
#define PriceColor RGBColor(240, 63, 16)//价格颜色
#define themeColor RGBHex(0xe54b4b)//主题色
#define themeTextColor RGBHex(0x999999)//主题字体色
#define kQTColor_Title           [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1]
#define quLineColor RGBColor(243,187,102)//取餐线路颜色
#define songLineColor RGBColor(110,177,117)//送餐线路颜色
/**
 导航栏背景颜色等设置
 */
#define kBGC_navBar(A)           [self.navigationController.navigationBar setBarTintColor:A]
#define kColor_navbarTitle(A)    [self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:20],NSForegroundColorAttributeName:A}]
#define kColor_navbarTintColor(A)  [self.navigationController.navigationBar setTintColor:A]



#define kAppPayali               @"kAppPayali"
#define kAppPaywei               @"kAppPaywei"
#define kRefreshCar              @"krefreshcar"
#define kRefreshGoodsDetail              @"krefreshgoodsdetail"
#define kRefreshGoodsDetailxs              @"krefreshgoodsdetailxs"

#define kRefreshOrderList              @"krefreshorderlist"
#define kAppKey                  @"alipayzsjq"
#define kUrlScheme               @"ZHJQ"

#define kAnimationDurationTime   0.35
#define kColor_line              [UIColor colorWithRed:0.902 green:0.902 blue:0.902 alpha:1]
#define SCREEN_RECT             ([UIScreen mainScreen].bounds)
#define kQTUserDefaults          [NSUserDefaults standardUserDefaults]
#define kMark_userCookie         @"ticket"          //登录凭证
#define kInfoPersonPath          @"info.plist"


/*
 读取图片
 */
#define LOADIMAGE(file,ext) [UIImage imageWithContentsOfFile:[[NSBundle mainBundle]pathForResource:file ofType:ext]]
#define IMAGE(imageName) [UIImage imageNamed:[NSString stringWithFormat:@"%@",imageName]]
/**
 占位图
 */
#define Placeholder_small   IMAGE(@"placeholder")
#define Placeholder_middle  IMAGE(@"placeholder")
#define Placeholder_big IMAGE(@"placeholder")
#define EmptyImage IMAGE(@"empty")
#define DefaultImg [UIImage imageNamed:@"defaultImg"]
/*
 获取通知中心
 */
#define NotificationCenter [NSNotificationCenter defaultCenter]
/*
 获取缓存
 */
#define UserDefault [NSUserDefaults standardUserDefaults]
/*
 弱引用
 */
#define WeakObj(type) __weak typeof(type) weak##type = type;
/*
 强引用
 */
#define StrongSelf(type)  __strong typeof(type) strong##type = weak##type;

/*3
 宏定义单例化BusinessManager
 */
#define ShareBusinessManager [BusinessManager shareBusinessManager]


#define TIMERMAXTIME 60
/*
 个推cid
 */
#define GTCID  @""

#define kHOST_main               @"hostmain"





#endif /* Constant_h */
